package com.gintama.common.config;

import com.gintama.common.filter.HttpTraceLogFilter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnWebApplication
public class HttpTraceConfig {

    /**
     * Servlet跟踪过滤器配置类.
     */
    @ConditionalOnWebApplication(type = Type.SERVLET)
    static class ServletTraceFilterConfiguration{
        /**
         * Http跟踪日志过滤器.
         *
         * @return HTTP跟踪日志过滤器
         */
        @Bean
        public HttpTraceLogFilter httpTraceLogFilter() {
            return new HttpTraceLogFilter();
        }

    }

}
